/*
 * Copyright (C) 2010 EPRO
 */
package com.epro.dx.widget;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.epro.dx.R;

/**
 * 辅助获取商品列表adapter的子元素布局
 * @author cw55072
 * @version  [1.0, 2010-08-31]
 *
 */
public class ProductListAssistant
{
    
    private View baseView;
    
    private TextView productName, prodcutPrice, productCarriage, reviewCount;
    
    private ImageView productIcon;
    
    private ImageView productRating;
    
    public ProductListAssistant(View baseView)
    {
        this.baseView = baseView;
    }
    
    public TextView getProductNameView()
    {
        if (productName == null)
        {
            productName = (TextView)baseView.findViewById(R.id.product_name);
        }
        return productName;
    }
    
    public TextView getProductPriceView()
    {
        if (prodcutPrice == null)
        {
            prodcutPrice = (TextView)baseView.findViewById(R.id.prodcut_price);
        }
        return prodcutPrice;
    }
    
    //    public TextView getProductCarriageView()
    //    {
    //        if (productCarriage == null)
    //        {
    //            productCarriage = (TextView)baseView.findViewById(R.id.product_carriage);
    //        }
    //        return productCarriage;
    //    }
    
    public TextView getReviewCountView()
    {
        if (reviewCount == null)
        {
            reviewCount = (TextView)baseView.findViewById(R.id.review_count);
        }
        return reviewCount;
    }
    
    public ImageView getProductIconView()
    {
        if (productIcon == null)
        {
            productIcon = (ImageView)baseView.findViewById(R.id.product_icon);
        }
        return productIcon;
    }
}
